import axios from "axios";

export const getForms = (data) => {
  return axios({
    method: "post",
    url: "/api/text/export-to-excel-new",
    data,
    headers: {
      "Content-Type": "application/json",
    },
    responseType: "blob",
  });
};

// 获取模板列表
export const templateList = (data) => {
  return axios({
    method: "post",
    url: "/api/template/list",
    data,
    headers: {
      "Content-Type": "application/json",
    },
  });
};

// 根据模板代码查询模板规范
export const textCode = (templateCode) => {
  return axios({
    method: "get",
    url: `/api/template/text/code/${templateCode}`,
    headers: {
      "Content-Type": "application/json",
    },
  });
};

// 保存模板规范
export const textUpdate = (data) => {
  return axios({
    method: "PUT",
    url: `/api/template/text/save`,
    data,
    headers: {
      "Content-Type": "application/json",
    },
  });
};
